import request from 'umi-request';

export async function fakeChartData() {
  return request('/api/fake_chart_data');
}

export async function getMainInfo() {
  return request(`/api/member/api-member/index/getMainInfo`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function getPreInfo() {
  return request(`/api/member/api-member/index/getPreInfo`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function getDoToEvent() {
  return request(`/api/member/api-member/index/getDoToEvent`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function getNotice() {
  return request(`/api/member/api-member/member/getNotice`, {
    method: 'post',
    data:{
      pageNum: 1,
      pageSize: 10,
      msgType:null,
      isDone:0,
      type:2
    },
  }).then((res) => {
    if (res.flag){
      return res.data;
    }
  });
}

export async function getBannerList() {
  return request(`/api/member/api-member/member/getCarouselList`, {
    method: 'post',
    data:{
      pageNum: 1,
      pageSize: 10,
    },
    requestType: 'form'
  }).then((res) => {
    if (res.flag){
      return res.data;
    }
  });
}
